package com.zzj.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDateTime;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 文章表
 * </p>
 *
 * @author zzj
 * @since 2023-07-18
 */
@Getter
@Setter
@TableName("blog_post")
@Schema(name = "Post", description = "$!{table.comment}")
public class Post implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "可见性  private、public")
    private String visibility;

    @Schema(description = "文章标题")
    private String title;

    @Schema(description = "封面")
    private String cover;

    private String content;

    @Schema(description = "作者id")
    private Integer userId;

    private String username;

    @Schema(description = "分类id")
    private Integer categoryId;

    private String categoryName;

    @Schema(description = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdAt;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;

    @Schema(description = "浏览量")
    private Integer views;

    @Schema(description = "点赞量")
    private Integer likes;

    @Schema(description = "评论量")
    private Integer comments;

    @Schema(description = "评论时间")
    private LocalDateTime commentedAt;

    @Schema(description = "标签 ,分隔")
    private String tags;
}
